package com.ty.day6;

import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 * Author : txy
 * Create 2023/11/2 17:38
 */
public class Six {
    public static void main(String[] args) {
        int x, y, a, b;
        Scanner sc = new Scanner(System.in);
        System.out.println("输入两个数：");
        a = sc.nextInt();
        b = sc.nextInt();
        x = a;
        y = b;
        int t;
        while (y > 0) {
            t = y;
            y = x % t;
            x = t;
        }
        System.out.println("最大公约数：" + x);
        System.out.println("最小公倍数：" + a * b / x);
    }
}
